# 定义主单的所有列名
mainColsNeeded = (
    'BRIDGE_ID', 'HISID', 'HOSPITAL_ID', 'HOSPITAL_NAME', 'P_LEVEL', 'BILL_DATE', 'MED_TYPE', 
    'IF_LOCAL_FLAG', 'SMT', 'PATIENT_ID', 'ID_CARD', 'PATIENT_NAME', 'PATIENT_GENDER', 
    'PATIENT_BIRTHDAY', 'PATIENT_AGE', 'BENEFIT_TYPE', 'BMI_AREA_ID', 'BMI_AREA_NAME', 
    'ADMISSION_DEPT_ID', 'ADMISSION_DEPT_NAME', 'TRANSFER_DEPT_NAME', 'DISCHARGE_DEPT_ID', 
    'DISCHARGE_DEPT_NAME', 'DOCTOR_ID', 'DOCTOR_NAME', 'ADMISSION_DATE', 'DISCHARGE_DATE', 
    'ZYTS', 'DISCHARGE_STATUS', 'TOTAL_AMOUNT', 'BMI', 'DBBX', 'YLJZ', 'GWYBC', 'QYBC', 
    'OTHER_PAY', 'CASH', 'SELF_AMOUNT', 'SELF_PAY_IN', 'SELF_PAY_OUT', 'INSCP_AMT', 'DISEASE_PAY', 
    'MAIN_DISEASE_ID', 'MAIN_DISEASE_NAME', 'ALL_DISEASE_ID', 'ALL_DISEASE_NAME', 
    'ALL_OPRN_ID', 'ALL_OPRN_NAME', 'HOSPITAL_AREA', 'MEDICAL_INSURANCE_FLAG'
)
# 定义主单的必须列名
mainColsMust = (
    'HISID', 'HOSPITAL_ID', 'HOSPITAL_NAME', 'BILL_DATE', 'MED_TYPE', 'IF_LOCAL_FLAG', 
    'SMT', 'PATIENT_ID', 'ID_CARD', 'PATIENT_NAME', 'PATIENT_GENDER', 'PATIENT_BIRTHDAY', 
    'PATIENT_AGE', 'BENEFIT_TYPE', 'BMI_AREA_ID', 'ADMISSION_DEPT_ID', 'ADMISSION_DEPT_NAME', 
    'DISCHARGE_DEPT_ID', 'DISCHARGE_DEPT_NAME', 'DOCTOR_ID', 'DOCTOR_NAME', 'ADMISSION_DATE', 
    'DISCHARGE_DATE', 'TOTAL_AMOUNT', 'BMI', 'DBBX', 'YLJZ', 'GWYBC', 'QYBC', 
    'OTHER_PAY', 'CASH', 'SELF_AMOUNT', 'MAIN_DISEASE_ID', 'MAIN_DISEASE_NAME', 
    'ALL_DISEASE_ID', 'ALL_DISEASE_NAME', 'ALL_OPRN_ID', 'ALL_OPRN_NAME', 'HOSPITAL_AREA', 'MEDICAL_INSURANCE_FLAG'
)
# 定义明细的所有列名
hilistColsNeeded = (
    'HISID', 'HOSPITAL_ID', 'HOSPITAL_NAME', 'PATIENT_ID', 'BILLING_DEPT_NAME', 'EXCUTE_DEPT_NAME', 
    'DOCTOR_NAME', 'P_CATEGORY', 'USAGE_DATE', 'ITEM_ID_HOSP', 'ITEM_NAME_HOSP', 
    'ITEM_ID', 'ITEM_NAME', 'DRUG_SPEC', 'DOSAGE_FORM', 'PACKAGE_UNIT', 'UNIT_PRICE', 
    'NUMS', 'COSTS', 'SELF_PAY', 'INSCP_AMT', 'P_TYPE', 'P_TYPE_PCT', 'FLAG_TYPE'
)
# 定义明细的必须列名
hilistColsMust = (
    'HISID', 'HOSPITAL_ID', 'HOSPITAL_NAME', 'PATIENT_ID', 'BILLING_DEPT_NAME', 'EXCUTE_DEPT_NAME', 
    'DOCTOR_NAME', 'P_CATEGORY', 'USAGE_DATE', 'ITEM_ID_HOSP', 'ITEM_NAME_HOSP', 
    'ITEM_ID', 'ITEM_NAME', 'DRUG_SPEC', 'DOSAGE_FORM', 'PACKAGE_UNIT', 'UNIT_PRICE', 
    'NUMS', 'COSTS', 'SELF_PAY', 'INSCP_AMT', 'P_TYPE', 'P_TYPE_PCT', 'FLAG_TYPE'
)
# 定义主单字段的要求
mainColsDict = fields_info = {
    "BRIDGE_ID": {"ord": 1, "field": "BRIDGE_ID", "description": "病案号", "type": "字符型"},
    "HISID": {"ord": 2, "field": "HISID", "description": "结算单据号", "type": "字符型"},
    "HOSPITAL_ID": {"ord": 3, "field": "HOSPITAL_ID", "description": "医疗机构编码", "type": "字符型"},
    "HOSPITAL_NAME": {"ord": 4, "field": "HOSPITAL_NAME", "description": "医疗机构名称", "type": "字符型"},
    "P_LEVEL": {"ord": 5, "field": "P_LEVEL", "description": "医保结算等级", "type": "字符型"},
    "BILL_DATE": {"ord": 6, "field": "BILL_DATE", "description": "结算时间", "type": "字符型/日期型"},
    "MED_TYPE": {"ord": 7, "field": "MED_TYPE", "description": "医疗类别", "type": "字符型"},
    "IF_LOCAL_FLAG": {"ord": 8, "field": "IF_LOCAL_FLAG", "description": "异地标志", "type": "字符型"},
    "SMT": {"ord": 9, "field": "SMT", "description": "住院号/门诊号", "type": "字符型"},
    "PATIENT_ID": {"ord": 10, "field": "PATIENT_ID", "description": "医保个人编码", "type": "字符型"},
    "ID_CARD": {"ord": 11, "field": "ID_CARD", "description": "患者身份证号", "type": "字符型"},
    "PATIENT_NAME": {"ord": 12, "field": "PATIENT_NAME", "description": "患者姓名", "type": "字符型"},
    "PATIENT_GENDER": {"ord": 13, "field": "PATIENT_GENDER", "description": "患者性别", "type": "字符型"},
    "PATIENT_BIRTHDAY": {"ord": 14, "field": "PATIENT_BIRTHDAY", "description": "患者出生日期", "type": "字符型/日期型"},
    "PATIENT_AGE": {"ord": 15, "field": "PATIENT_AGE", "description": "患者年龄", "type": "数值型"},
    "BENEFIT_TYPE": {"ord": 16, "field": "BENEFIT_TYPE", "description": "险种类型", "type": "字符型"},
    "BMI_AREA_ID": {"ord": 17, "field": "BMI_AREA_ID", "description": "参保地统筹区域编码", "type": "字符型"},
    "BMI_AREA_NAME": {"ord": 18, "field": "BMI_AREA_NAME", "description": "参保地统筹区域名称", "type": "字符型"},
    "ADMISSION_DEPT_ID": {"ord": 19, "field": "ADMISSION_DEPT_ID", "description": "入院科室编码", "type": "字符型"},
    "ADMISSION_DEPT_NAME": {"ord": 20, "field": "ADMISSION_DEPT_NAME", "description": "入院科室名称", "type": "字符型"},
    "TRANSFER_DEPT_NAME": {"ord": 21, "field": "TRANSFER_DEPT_NAME", "description": "转科科室名称", "type": "字符型"},
    "DISCHARGE_DEPT_ID": {"ord": 22, "field": "DISCHARGE_DEPT_ID", "description": "出院科室编码", "type": "字符型"},
    "DISCHARGE_DEPT_NAME": {"ord": 23, "field": "DISCHARGE_DEPT_NAME", "description": "出院科室名称", "type": "字符型"},
    "DOCTOR_ID": {"ord": 24, "field": "DOCTOR_ID", "description": "门诊医师编码", "type": "字符型"},
    "DOCTOR_NAME": {"ord": 25, "field": "DOCTOR_NAME", "description": "门诊医师姓名", "type": "字符型"},
    "ADMISSION_DATE": {"ord": 26, "field": "ADMISSION_DATE", "description": "入院时间", "type": "字符型/日期型"},
    "DISCHARGE_DATE": {"ord": 27, "field": "DISCHARGE_DATE", "description": "出院时间", "type": "字符型/日期型"},
    "ZYTS": {"ord": 28, "field": "ZYTS", "description": "住院天数", "type": "数值型"},
    "DISCHARGE_STATUS": {"ord": 29, "field": "DISCHARGE_STATUS", "description": "离院方式", "type": "字符型"},
    "TOTAL_AMOUNT": {"ord": 30, "field": "TOTAL_AMOUNT", "description": "医疗总费用", "type": "数值型"},
    "BMI": {"ord": 31, "field": "BMI", "description": "基本统筹支付", "type": "数值型"},
    "DBBX": {"ord": 32, "field": "DBBX", "description": "大病保险支付", "type": "数值型"},
    "YLJZ": {"ord": 33, "field": "YLJZ", "description": "医疗救助支付", "type": "数值型"},
    "GWYBC": {"ord": 34, "field": "GWYBC", "description": "公务员补充保险支付", "type": "数值型"},
    "QYBC": {"ord": 35, "field": "QYBC", "description": "企业补充医疗保险支付", "type": "数值型"},
    "OTHER_PAY": {"ord": 36, "field": "OTHER_PAY", "description": "其他基金支付", "type": "数值型"},
    "CASH": {"ord": 37, "field": "CASH", "description": "个人现金付费", "type": "数值型"},
    "SELF_AMOUNT": {"ord": 38, "field": "SELF_AMOUNT", "description": "个人账户付费", "type": "数值型"},
    "SELF_PAY_IN": {"ord": 39, "field": "SELF_PAY_IN", "description": "个人自付", "type": "数值型"},
    "SELF_PAY_OUT": {"ord": 40, "field": "SELF_PAY_OUT", "description": "个人自费", "type": "数值型"},
    "INSCP_AMT": {"ord": 41, "field": "INSCP_AMT", "description": "符合医保范围金额", "type": "数值型"},
    "DISEASE_PAY": {"ord": 42, "field": "DISEASE_PAY", "description": "按病种结算支付金额", "type": "数值型"},
    "MAIN_DISEASE_ID": {"ord": 43, "field": "MAIN_DISEASE_ID", "description": "住院主诊断编码", "type": "字符型"},
    "MAIN_DISEASE_NAME": {"ord": 44, "field": "MAIN_DISEASE_NAME", "description": "住院主诊断名称", "type": "字符型"},
    "ALL_DISEASE_ID": {"ord": 45, "field": "ALL_DISEASE_ID", "description": "全部诊断编码", "type": "字符型"},
    "ALL_DISEASE_NAME": {"ord": 46, "field": "ALL_DISEASE_NAME", "description": "全部诊断名称", "type": "字符型"},
    "ALL_OPRN_ID": {"ord": 47, "field": "ALL_OPRN_ID", "description": "全部手术代码", "type": "字符型"},
    "ALL_OPRN_NAME": {"ord": 48, "field": "ALL_OPRN_NAME", "description": "全部手术名称", "type": "字符型"},
    "HOSPITAL_AREA": {"ord": 49, "field": "HOSPITAL_AREA", "description": "院区", "type": "字符型"},
    "MEDICAL_INSURANCE_FLAG": {"ord": 50, "field": "MEDICAL_INSURANCE_FLAG", "description": "医保结算与非医保结算标志", "type": "字符型"},
}
# 定义收费明细字段的要求
hilistColsDict = {
    "HISID": {"ord": 1, "field": "HISID", "description": "结算单据号", "type": "字符型"},
    "HOSPITAL_ID": {"ord": 2, "field": "HOSPITAL_ID", "description": "医疗机构编码", "type": "字符型"},
    "HOSPITAL_NAME": {"ord": 3, "field": "HOSPITAL_NAME", "description": "医疗机构名称", "type": "字符型"},
    "PATIENT_ID": {"ord": 4, "field": "PATIENT_ID", "description": "医保个人编码", "type": "字符型"},
    "BILLING_DEPT_NAME": {"ord": 5, "field": "BILLING_DEPT_NAME", "description": "开单科室名称", "type": "字符型"},
    "EXCUTE_DEPT_NAME": {"ord": 6, "field": "EXCUTE_DEPT_NAME", "description": "执行科室名称", "type": "字符型"},
    "DOCTOR_NAME": {"ord": 7, "field": "DOCTOR_NAME", "description": "开单医师姓名", "type": "字符型"},
    "P_CATEGORY": {"ord": 8, "field": "P_CATEGORY", "description": "费用类别", "type": "字符型"},
    "USAGE_DATE": {"ord": 9, "field": "USAGE_DATE", "description": "费用发生时间", "type": "字符型/日期型"},
    "ITEM_ID_HOSP": {"ord": 10, "field": "ITEM_ID_HOSP", "description": "医院项目编码", "type": "字符型"},
    "ITEM_NAME_HOSP": {"ord": 11, "field": "ITEM_NAME_HOSP", "description": "医院项目名称", "type": "字符型"},
    "ITEM_ID": {"ord": 12, "field": "ITEM_ID", "description": "医保项目编码", "type": "字符型"},
    "ITEM_NAME": {"ord": 13, "field": "ITEM_NAME", "description": "医保项目名称", "type": "字符型"},
    "DRUG_SPEC": {"ord": 14, "field": "DRUG_SPEC", "description": "规格", "type": "字符型"},
    "DOSAGE_FORM": {"ord": 15, "field": "DOSAGE_FORM", "description": "剂型", "type": "字符型"},
    "PACKAGE_UNIT": {"ord": 16, "field": "PACKAGE_UNIT", "description": "计价单位", "type": "字符型"},
    "UNIT_PRICE": {"ord": 17, "field": "UNIT_PRICE", "description": "单价", "type": "数值型"},
    "NUMS": {"ord": 18, "field": "NUMS", "description": "数量", "type": "数值型"},
    "COSTS": {"ord": 19, "field": "COSTS", "description": "金额", "type": "数值型"},
    "SELF_PAY": {"ord": 20, "field": "SELF_PAY", "description": "自费金额", "type": "数值型"},
    "INSCP_AMT": {"ord": 21, "field": "INSCP_AMT", "description": "符合医保范围金额", "type": "数值型"},
    "P_TYPE": {"ord": 22, "field": "P_TYPE", "description": "支付类别", "type": "字符型"},
    "P_TYPE_PCT": {"ord": 23, "field": "P_TYPE_PCT", "description": "报销比例", "type": "字符型"},
    "FLAG_TYPE": {"ord": 24, "field": "FLAG_TYPE", "description": "处方退费标识", "type": "字符型"},
}